﻿@using AC.Code.Config
@using AC.Util
@model wychuan2.com.Areas.admin.Models.DbTools.DbSettingModel
@{
    ViewBag.Title = "代码生成设置";
    Layout = "../Shared/_Layout.cshtml";
}

@{
    string jsonTemplates = JsonHelper.ToJson(Model.Templates);
}
@section styles{
<link href="~/Content/plugins/highlighter/shCore.css" rel="stylesheet" />
<link href="~/Content/plugins/highlighter/shCoreDefault.css" rel="stylesheet" />
}

<div class="alert alert-success alert-dismissable">
    <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
    请仔细填写下面配置，保存后会更新到Cookie中，作为代码生成的一个配置项
</div>
<div class="row">
    <div class="col-lg-12">
        <div class="ibox ">
            <div class="ibox-title">
                <h5>C#代码生成配置</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="ibox-content J_Container" data-language="1" id="csharp">
                <div class="row">
                    <div class="col-lg-5">
                        <form role="form" id="form" novalidate="novalidate">
                            <div class="form-group">
                                <label>Author</label>
                                <input name="author" type="text" placeholder="请输入Author" class="form-control" value="@Model.CsharpTemplate.Author">
                            </div>
                            <div class="form-group">
                                <label>表名示例</label>
                                <p class="form-control-static text-navy"><strong name="tableName">User</strong></p>
                            </div>
                            <div class="form-group" data-type="1">
                                <label>命名空间</label>
                                @*<label class="radio-inline">
                                    <input type="radio" name="cnamespace" value="1" checked="checked">统一命名空间
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="cnamespace" value="2" checked="checked">独立命名空间
                                </label>*@
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="namespacetype" value="1" checked="checked">统一命名空间
                                    </label>
                                </div>
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="namespacetype" value="2">独立命名空间
                                    </label>
                                </div>
                            </div>
                            <div class="form-group" name="namespace-ty">
                                <label>NameSpace</label>
                                <input type="text" placeholder="Common Namespace eg: Eds" class="form-control" name="namespace" value="@Model.CsharpTemplate.CommonNamespace">
                            </div>
                            <div class="form-group">
                                <label>DTO</label>
                                <input type="text" placeholder="DTO NameSpace eg: Eds.Service.DTO" class="form-control J_Names" name="namespaceOfDTO" value="@Model.CsharpTemplate.DtoOrDomainNamespace" disabled>
                            </div>
                            <div class="form-group">
                                <label>ServiceInterface</label>
                                <input type="text" placeholder="ServiceInterface NameSpace eg: Eds.Service" class="form-control J_Names" name="namespaceOfServiceInter" value="@Model.CsharpTemplate.ServiceInterNamespace" disabled>
                            </div>
                            <div class="form-group">
                                <label>Service</label>
                                <input type="text" placeholder="Service NameSpace eg: Eds.Service.Impl" class="form-control J_Names" name="namespaceOfService" value="@Model.CsharpTemplate.ServiceNamespace" disabled>
                            </div>
                            <div class="form-group">
                                <label>DaoInterface</label>
                                <input type="text" placeholder="DaoInterface NameSpace eg: Eds.Dao.IRepos" class="form-control J_Names" name="namespaceOfDaoInter" value="@Model.CsharpTemplate.DaoInterNamespace" disabled>
                            </div>
                            <div class="form-group">
                                <label>Dao</label>
                                <input type="text" placeholder="Dao NameSpace eg: Eds.Dao" class="form-control J_Names" name="namespaceOfDao" value="@Model.CsharpTemplate.DaoNamespace" disabled>
                            </div>
                            
                            <div>
                                <button name="btnSave" class="btn btn-sm btn-primary m-t-n-xs" type="button">
                                    <strong>保存</strong>
                                </button>
                            </div>
                        </form>
                    </div>
                    <div class="col-lg-7">
                        <ul class="nav nav-tabs">
                            <li class="active">
                                <a href="#cserviceInterDemo" data-toggle="tab">ServiceInter</a>
                            </li>
                            <li>
                                <a href="#cserviceDemo" data-toggle="tab">Service</a>
                            </li>
                            <li>
                                <a href="#cdtoDemo" data-toggle="tab">Dto</a>
                            </li>
                            <li>
                                <a href="#cdaoInterDemo" data-toggle="tab">DaoInter</a>
                            </li>
                            <li>
                                <a href="#cdaoDemo" data-toggle="tab">Dao</a>
                            </li>
                        </ul>
                        <div class="tab-content">
                            <div class="tab-pane active" id="cserviceInterDemo" name="serviceInterDemo">
                                <pre class="brush:csharp"></pre>
                            </div>
                            <div class="tab-pane" id="cserviceDemo">
                                <pre class="brush:csharp"></pre>
                            </div>
                            <div class="tab-pane" id="cdtoDemo" name="dtoDemo">
                                <pre class="brush:csharp"></pre>
                            </div>
                            <div class="tab-pane" id="cdaoInterDemo">
                                <pre class="brush:csharp"></pre>
                            </div>
                            <div class="tab-pane" id="cdaoDemo">
                                <pre class="brush:csharp"></pre>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-lg-12">
        <div class="ibox ">
            <div class="ibox-title">
                <h5>Java代码生成配置</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="ibox-content J_Container" data-language="2" id="java">
                <div class="row">
                    <div class="col-lg-5">
                        <form role="form" id="form" novalidate="novalidate">
                            <div class="form-group">
                                <label>Author</label>
                                <input value="@Model.JavaTemplate.Author" name="author" type="text" placeholder="请输入Author" class="form-control">
                            </div>
                            <div class="form-group">
                                <label>表名示例</label>
                                <p class="form-control-static text-navy"><strong name="tableName">User</strong></p>
                            </div>
                            <div class="form-group" data-type="1">
                                <label>命名空间</label>
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="namespacetype" value="1" checked="checked">统一命名空间
                                    </label>
                                </div>
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="namespacetype" value="2">独立命名空间
                                    </label>
                                </div>
                            </div>
                            <div class="form-group" name="namespace-ty">
                                <label>NameSpace</label>
                                <input value="@Model.JavaTemplate.CommonNamespace" type="text" placeholder="Common Namespace eg: Eds" class="form-control" name="namespace">
                            </div>
                            <div class="form-group">
                                <label>DTO</label>
                                <input type="text" value="@Model.JavaTemplate.DtoOrDomainNamespace" placeholder="DTO NameSpace eg: Eds.Service.DTO" class="form-control J_Names" name="namespaceOfDTO" disabled>
                            </div>
                            <div class="form-group">
                                <label>ServiceInterface</label>
                                <input type="text" value="@Model.JavaTemplate.ServiceInterNamespace" placeholder="ServiceInterface NameSpace eg: Eds.Service" class="form-control J_Names" name="namespaceOfServiceInter" disabled>
                            </div>
                            <div class="form-group">
                                <label>Service</label>
                                <input type="text" value="@Model.JavaTemplate.ServiceNamespace" placeholder="Service NameSpace eg: Eds.Service.Impl" class="form-control J_Names" name="namespaceOfService" disabled>
                            </div>
                            <div class="form-group">
                                <label>DaoInterface</label>
                                <input type="text" value="@Model.JavaTemplate.DaoInterNamespace" placeholder="DaoInterface NameSpace eg: Eds.Dao.IRepos" class="form-control J_Names" name="namespaceOfDaoInter" disabled>
                            </div>
                            <div class="form-group">
                                <label>Dao</label>
                                <input type="text" value="@Model.JavaTemplate.DaoNamespace" placeholder="Dao NameSpace eg: Eds.Dao" class="form-control J_Names" name="namespaceOfDao" disabled>
                            </div>

                            <div>
                                <button name="btnSave" class="btn btn-sm btn-primary m-t-n-xs" type="button">
                                    <strong>保存</strong>
                                </button>
                            </div>
                        </form>
                    </div>
                    <div class="col-lg-7">
                        <ul class="nav nav-tabs">
                            <li class ="active">
                                <a href="#serviceInterDemo" data-toggle="tab">ServiceInter</a>
                            </li>
                            <li>
                                <a href="#serviceDemo" data-toggle="tab">Service</a>
                            </li>
                            <li>
                                <a href="#dtoDemo" data-toggle="tab">Dto</a>
                            </li>
                            <li>
                                <a href="#daoInterDemo" data-toggle="tab">DaoInter</a>
                            </li>
                            <li>
                                <a href="#daoDemo" data-toggle="tab">Dao</a>
                            </li>
                        </ul>
                        <div class="tab-content">
                            <div class="tab-pane active" id="serviceInterDemo" name="serviceInterDemo">
                                <pre class="brush:java"></pre>
                            </div>
                            <div class="tab-pane" id="serviceDemo">
                                <pre class="brush:java"></pre>
                            </div>
                            <div class="tab-pane" id="dtoDemo" name="dtoDemo">
                                <pre class="brush:java"></pre>
                            </div>
                            <div class="tab-pane" id="daoInterDemo">
                                <pre class="brush:java"></pre>
                            </div>
                            <div class="tab-pane" id="daoDemo">
                                <pre class="brush:java"></pre>
                            </div>
                        </div>
                     </div>
                </div>
            </div>
        </div>
    </div>
</div>


@section scripts{
    <script type="text/javascript" src="~/Scripts/plugins/highlighter/shCore.js"></script>
    <script type="text/javascript" src="~/Scripts/plugins/highlighter/shBrushCSharp.js"></script>
    <script type="text/javascript" src="~/Scripts/plugins/highlighter/shBrushJava.js"></script>
    <script src="~/Scripts/extension.js"></script>
    <script type="text/javascript">

        window.templates = @Html.Raw(jsonTemplates);

    </script>
    <script src="~/Scripts/dbtools/settings.js"></script>
}